package com.lzg.okrx.adapter

import com.lzy.okgo.adapter.AdapterParam
import com.lzy.okgo.adapter.Call
import com.lzy.okgo.adapter.CallAdapter
import com.lzy.okgo.model.Response

import io.reactivex.BackpressureStrategy
import io.reactivex.Flowable

class FlowableResponse<T> : CallAdapter<T, Flowable<Response<T>>> {

    override fun adapt(call: Call<T>, param: AdapterParam): Flowable<Response<T>> =
        ObservableResponse<T>()
            .adapt(call, param)
            .toFlowable(BackpressureStrategy.LATEST)

}
